Skip to content

Conversation

@schultek
Copy link
Contributor

@schultek schultek commented Oct 28, 2025

This adds a dynamic tooltip to each link pointing to the flutter api docs. The tooltip shows a short preview of the docs on hover (or focus, or tap on mobile).

Bildschirmfoto 2025-10-28 um 12 14 22

@schultek schultek requested review from a team and sfshaza2 as code owners October 28, 2025 11:13
@schultek schultek requested review from parlough and removed request for sfshaza2 October 28, 2025 11:13
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @schultek, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the user experience on the site by implementing interactive tooltips for Flutter API documentation links. Instead of requiring users to navigate to a new page, these tooltips provide a concise preview of the API entry directly on hover, focus, or tap, streamlining the information discovery process. The implementation includes new styling, a client-side component for fetching and rendering the tooltip content, and a page extension to automatically apply this functionality to relevant links.

Highlights

  • API Docs Tooltips: Introduces dynamic tooltips for links pointing to Flutter API documentation.
  • Content Preview: Tooltips display a short preview of the linked API documentation on hover, focus, or tap (for mobile).
  • Responsive Interaction: Tooltip visibility and interaction are adapted for both touch and non-touch devices.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a great new feature, adding dynamic tooltips to API documentation links. The implementation is well-structured, using a client-side Jaspr component and a content processor to automatically enhance the links. The SCSS is clean and the component correctly handles different interaction models for touch and non-touch devices. However, I've identified a few critical issues in the client-side Dart code that could lead to runtime errors and crash the script. I've also found a high-severity usability issue on touch devices that prevents link navigation. My review includes specific code suggestions to address these points and make the feature more robust and user-friendly.

@flutter-website-bot
Copy link
Collaborator

flutter-website-bot commented Oct 28, 2025

Visit the preview URL for this PR (updated for commit 140503b):

https://flutter-docs-prod--pr12600-feat-api-tooltip-0vjb2n7x.web.app

@parlough
Copy link
Member

Exciting! I haven't reviewed the code yet, but is there some common popover/tooltip component we can extract out that this, glossary terms, and whatever else can share?

@schultek
Copy link
Contributor Author

Yes, but I would do it when we actually have a second use-case for this. But I tried to keep this and the glossary cards in site-www already pretty similar.

Base automatically changed from feat/jaspr-migration to main October 28, 2025 20:15
@parlough
Copy link
Member

@schultek When you get a chance can you rebase this on main?

@schultek
Copy link
Contributor Author

@parlough Done

@parlough
Copy link
Member

Overall looks great to me, but won't we need to update the CORS configuration on api.flutter.dev for this to work? How did you test this?

@schultek
Copy link
Contributor Author

Overall looks great to me, but won't we need to update the CORS configuration on api.flutter.dev for this to work? How did you test this?

Oh yes good that you caught this, I fully forget to raise this.
Because locally I use a cors extension in chrome that mitigates this for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants